<?php
include("database.php");
session_start();

  $idcheck = base64_decode($_POST['donate_id']);
  $adminName ="";
  if(isset($_SESSION['Username'])) {
	$adminName = $_SESSION['Username'];
  }
  else $adminName = 'admin';
  $GeneratedTimestamp=date('Y-m-d H:i:s');
  
  if($_POST==null) {}
    else {
      extract($_POST);

      $update = mysqli_query($con,"UPDATE DonateList SET Deleted = 1 WHERE ID='$idcheck'") or die (mysql_error());
  
      $query="INSERT into DeleteReason (donate_id, username, reason, time)
      VALUES ('$idcheck', '$adminName', '$reason', '$GeneratedTimestamp')";
	
      if (!mysqli_query($con,$query)) { die('Error: ' . mysqli_error($con)); }

    }

?>